package com.buaa.enums;

public enum ResponseCode {
//    错误编码，由5位数字组成，前2位为模块编码，后3位为业务编码
    // 10 表示 登录 LoginService code , LOGIN_XXXX 开头

    // --------------  登录相关的 code 和 message  start -----------------------------------
    // 成功均返回 200， 前端统一判定200 ，非200 视为error
    LOGIN_NOT_NULL("10001", "交警用户或者密码不能为空"),
    LOGIN_USER_NOT_EXIST("10002", "交警用户不存在"),
    LOGIN_USER_PASSWORD_ERROR("10003", "交警用户名或密码错误"),
    //登录时
    COMMON_SYS_ERROR("10004", "服务层执行数据库语句错误,请联系管理员."),

    LOGIN_TOKEN_NULL("10005", "无token,验证失败"),
    LOGIN_TOKEN_FAILED("10006", "token验证失败，请重新登录"),

    // --------------  登录相关的 code 和 message end -----------------------------------


    // 20 表示新增，更新，删除 用户账号信息

    Add_USER_SECCESS("200", "添加交警账号成功."),
    USER_ALREADY_EXIST("20002", "交警编号已经存在"),

    UPDATE_USER_SECCESS("200", "更新交警账号信息成功."),
    UPDATE_USER_FAILURE("20001", "更新用户账号信息失败."),

    QRY_FAILURE("20003", "查询数据失败."),

    // 更新交警信息

    QRY_USER_EXT_FAILURE("30000", "查询交警信息失败"),
    DEL_USER_EXT_SECCESS("200", "清理交警信息成功."),

    DEL_USER_EXT_INFO("200", "交警信息不存在,无需清除."),
    DEL_USER_EXT_FAILURE("30001", "清理交警信息失败."),

    INSERT_USER_EXT_SECCESS("200", "更新交警用户信息成功."),
    INSERT_USER_EXT_FAILURE("30002", "更新交警用户信息失败."),

    UPDATE_USER_EXT_SECCESS("200", "更新交警用户信息成功."),
    UPDATE_USER_EXT_FAILURE("30002", "更新交警用户信息失败."),

    DEL_USER_EXT_BULK_SECCESS("200", "批量删除交警信息成功."),

    DEL_USER_EXT_BULK_INFO("200", "交警用户信息为空,无需重复清除."),


    DEL_USER_EXT_BULK_FAILURE("30003", "批量删除交警信息成功."),

    //交通场景图绘制 code
    SCENE_MAP_SUCCESS("200", "交通场景图绘制成功."),
    SCENE_MAP_FAILURE("40001", "交通场景图绘制失败."),

    POLICE_INCIDENT_SUCCESS("200", "添加案件信息成功."),
    POLICE_INCIDENT_FAILURE("40001", "添加案件信息失败."),

    // 报告 code
    ECHARTS_SUCCESS("200", "查询数据成功" ),
    ECHARTS_FAILURE("20001", "查询数据失败" ),

    QA_SUCCESS("200", "知识应答成功" ),
    QA_FAILURE("30001", "知识应答失败" ),

    // 通用返回，参数为空， 204
    SC_NO_CONTENT("204","参数为空"),
    DB_EXEC_ERROR("900", "数据库执行异常"),


    //http 标准返回码
    LOGIN_SUCCESS("200", "登录成功"), // int SC_OK = 200;

    LOGOUT_SUCCESS("200", "登录成功"); // int SC_OK = 200;

    private final String key;
    private final String desc;

    public String getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }



    ResponseCode(final String key, final String desc) {
        this.key = key;
        this.desc = desc;
    }

//    int INTERNAL_SERVER_ERROR = 500;
//    int UNAUTHORIZED = 401;
//
//    int NOT_NULL = 10001;
//    int DB_RECORD_EXISTS = 10002;
//    int PARAMS_GET_ERROR = 10003;
//    int ACCOUNT_PASSWORD_ERROR = 10004;
//    int ACCOUNT_DISABLE = 10005;
//    int IDENTIFIER_NOT_NULL = 10006;
//    int CAPTCHA_ERROR = 10007;
//    int SUB_MENU_EXIST = 10008;
//    int PASSWORD_ERROR = 10009;
//    int SUPERIOR_DEPT_ERROR = 10011;
//    int SUPERIOR_MENU_ERROR = 10012;
//    int DATA_SCOPE_PARAMS_ERROR = 10013;
//    int DEPT_SUB_DELETE_ERROR = 10014;
//    int DEPT_USER_DELETE_ERROR = 10015;
//    int UPLOAD_FILE_EMPTY = 10019;
//    int TOKEN_NOT_EMPTY = 10020;
//    int TOKEN_INVALID = 10021;
//    int ACCOUNT_LOCK = 10022;
//    int OSS_UPLOAD_FILE_ERROR = 10024;
//    int REDIS_ERROR = 10027;
//    int JOB_ERROR = 10028;
//    int INVALID_SYMBOL = 10029;
//
//    HTTP CODE
//    int SC_CONTINUE = 100;
//    int SC_SWITCHING_PROTOCOLS = 101;
//    int SC_PROCESSING = 102;
//    int SC_OK = 200;
//    int SC_CREATED = 201;
//    int SC_ACCEPTED = 202;
//    int SC_NON_AUTHORITATIVE_INFORMATION = 203;
//    int SC_NO_CONTENT = 204;
//    int SC_RESET_CONTENT = 205;
//    int SC_PARTIAL_CONTENT = 206;
//    int SC_MULTI_STATUS = 207;
//    int SC_MULTIPLE_CHOICES = 300;
//    int SC_MOVED_PERMANENTLY = 301;
//    int SC_MOVED_TEMPORARILY = 302;
//    int SC_SEE_OTHER = 303;
//    int SC_NOT_MODIFIED = 304;
//    int SC_USE_PROXY = 305;
//    int SC_TEMPORARY_REDIRECT = 307;
//    int SC_BAD_REQUEST = 400;
//    int SC_UNAUTHORIZED = 401;
//    int SC_PAYMENT_REQUIRED = 402;
//    int SC_FORBIDDEN = 403;
//    int SC_NOT_FOUND = 404;
//    int SC_METHOD_NOT_ALLOWED = 405;
//    int SC_NOT_ACCEPTABLE = 406;
//    int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
//    int SC_REQUEST_TIMEOUT = 408;
//    int SC_CONFLICT = 409;
//    int SC_GONE = 410;
//    int SC_LENGTH_REQUIRED = 411;
//    int SC_PRECONDITION_FAILED = 412;
//    int SC_REQUEST_TOO_LONG = 413;
//    int SC_REQUEST_URI_TOO_LONG = 414;
//    int SC_UNSUPPORTED_MEDIA_TYPE = 415;
//    int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
//    int SC_EXPECTATION_FAILED = 417;
//    int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
//    int SC_METHOD_FAILURE = 420;
//    int SC_UNPROCESSABLE_ENTITY = 422;
//    int SC_LOCKED = 423;
//    int SC_FAILED_DEPENDENCY = 424;
//    int SC_INTERNAL_SERVER_ERROR = 500;
//    int SC_NOT_IMPLEMENTED = 501;
//    int SC_BAD_GATEWAY = 502;
//    int SC_SERVICE_UNAVAILABLE = 503;
//    int SC_GATEWAY_TIMEOUT = 504;
//    int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
//    int SC_INSUFFICIENT_STORAGE = 507;
}
